<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
		<script src="../../script/mui.min.js"></script>
		<script src="../../script/jquery.min.js"></script>
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">
		<link rel="stylesheet" href="../../css/base.css"/>
		<link rel="stylesheet" href="../../css/personal.css">
		<link rel="stylesheet" href="../../css/exam.css">
		<link rel="stylesheet" href="../../css/swiper-3.4.2.min.css">
		<title>模拟考试页</title>
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
		<style>
			.weui_mask {
				position: fixed;
				z-index: 998;
				top: 0;
				right: 0;
				bottom: 0;
				left: 0;
			}
			.weui_dialog {
				z-index: 999;
			}
			.swiper-wrapper {
				min-height: 400px
			}
			.stu-test .mui-btn-primary {
				color: #fff;
				background-color: #FF9900;
				border: 1px solid #FF9900;
				padding-left: 2em;
				padding-right: 2em;
			}
			.questionItemImgDiv {
				height: 12em;
				width: 80%;
				max-height: 14em;
				max-width: 95%;
				margin-left: 13px;
			}
			.xuanzeImgDiv {
				width: 80%;
				height: 8em;
				max-height: 10em;
			}
			.swiper-wrapper {
				min-height: 400px
			}
			.tiankong {
				font-family: inherit;
				border-bottom: 1px solid #000;
				margin: 0 8px;
				text-align: center;
				width: auto;
				/*word-break:break-all*/
			}
			.question_video_div {
				padding: 10px 10px;
				padding-left: 20px;
			}
			.question_video_div	video {
				width: 100%;
				height: 13em;
				background-color: black;
			}
			.question_video_div	img {
				width: 100%;
				height: 10em;
				background-color: black;
			}
			.option_video_div {
				padding: 10px 10px;
				padding-left: 55px;
			}
			.option_video_div	img {
				width: 100%;
				height: 8em;
				background-color: black;
			}
			.option_video_div	video {
				width: 100%;
				height: 12em;
			}
			table {
				border: 1px solid #ccc;
				border-collapse: collapse;
				border-spacing: 0;
			}
			td, th {
				border: 1px solid #ccc;
				padding: 0;
				text-align: center;
				color: #222222;
				font-size: 14px;
			}
			p {
				text-indent: 5px !important;
			}
		</style>
	</head>
	<body >
		<div class="stu-test" id="scroll">
			<div class="base_style_color" id='BarAppearance' style="height: 22px;width: 100%; position:fixed; left: 0px;top:0px;z-index: 998" ></div>
			<div class="base_navigation_bar base_style_color base_navigation_item_bar" style="position: fixed;left: 0px;top: 20px;">
				<div class="base_navigation_bar base_style_color base_navigation_item_bar">
					<a class="base_left_item" href="#" onclick="backKey()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
					<span id="title">模拟考试</span>
				</div>
			</div>
			<div class="space10 " style="margin-top: 64px"></div>
			<div class="k-con-border qusetion-type " >
				<div class="k-con-part" style="position: static">
					<p class="k-text-center k-c323 k-f12">
						<span class="test-score-detail "> 试卷分数：<span class="k-cred" id="score"></span>分 </span>
						<span class="test-score-detail"> 通过分数：<span class="k-cred" id="passscore"></span>分 </span>
						<span class="test-score-detail"> 考试时间：<span class="k-cred" id="kstime"></span>分钟</span>
					</p>
				</div>
			</div>
			<div class="k-con test-m-bottom70 test-analysis" id="question_div">
				<div class="swiper-container">
					<div class="swiper-wrapper" >
						<!--	<div class="swiper-slide" id="item' + (i + 1) + '" itemtype="' + data.qtype + '" qid="' + data.qid + '">
						<div class="k-con-part3 clearfix">
						<span id="itemType" class="k-f18">填空题</span>
						<p class="k-f16 k-c323 k-mt5 indent-5">
						<img class="questionltemlmgDiv" src="http://bos.cfnet.org.cn/img/20180713/1531463882-250008-21245.png@s_0,w_480">
						</p>
						<div class="test-answer-list left_10"  id="question_item' + data.qid + '"  onclick="GetAnswerData(' + i + ')">
						<div class="mui-input-row mui-checkbox mui-left">
						<div class="option_video_div"  video-url="' + VideoUrlArr[0] + '" onclick="toPlayVideo(this)"><img src="../../image/img_voide.png"/></div>
						<input  Itemindex="' + i + '" dataindex="' + (k + 1) + '" name="checkbox1" value="Item 1" type="checkbox"  itemid="' + data.qid + '">'
						</div>;
						</div>
						</div>
						</div>-->
					</div>
				</div>
			</div>
			<div class="k-con1 k-text-center k-fixed-bottom test-bottom1" id="sub_div">
				<div class="k-con-part1" id="submit_div" style="display: none">
					<div class="remainingtime ">
						<span> 倒计时 </span>
						<span id="kaoShiTime" class="k-cred"></span>
					</div>
					<button type="button" class="mui-btn mui-btn-primary" onclick="CheckSubmit()">
						交卷
					</button>
					<div class="test_card_div">
						<a class="base_right_item "style="color: #18B4ED" href="#popover-card">答题卡 </a>
					</div>
				</div>
				<div class="k-con-part" id='score_div' style="display: none">
					<span class="test-score-detail"> 你的分数：<span class="k-cred" id="Testscore" ></span>分 </span>
					<div class="test_card_div" style="top: -10px">
						<a class="base_right_item "style="color: #18B4ED" href="#popover-card">答题卡 </a>
					</div>
				</div>
			</div>
			<div id="popover-card" class="mui-popover test-num-card" style=" width: 97%;">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll" id="scroll-card"></div>
				</div>
			</div>
		</div>
		<div id="offlineAlert" class="weui_dialog_confirm" style="display: none;">
			<div class="weui_mask"></div>
			<div class="weui_dialog">
				<div class="weui_dialog_hd">
					<strong class="weui_dialog_title" id="checkNum"></strong>
				</div>
				<div class="weui_dialog_bd"></div>
				<div class="weui_dialog_ft">
					<a onclick="cleanCancel()" href="#" class="weui_btn_dialog default"  style="color:#18b4ed">取消</a>
					<a onclick="cleanConfirm()" href="#" class="weui_btn_dialog primary"  style="color:#18b4ed">确定</a>
				</div>
			</div>
		</div>
		<div class="weui_dialog_alert" id="closeAlert" style="display: none;">
			<div class="weui_mask"></div>
			<div class="weui_dialog">
				<div class="weui_dialog_hd">
					<strong class="weui_dialog_title" id="checkNum2"></strong>
				</div>
				<div class="weui_dialog_ft">
					<a onclick="Cancel()" href="#" class="weui_btn_dialog primary"  style="color:#18b4ed">确定</a>
				</div>
			</div>
		</div>
		<div class="weui_dialog_alert" id="scoreAlert" style="display: none;">
			<div class="weui_mask"></div>
			<div class="weui_dialog">
				<div class="weui_dialog_hd">
					<strong class="weui_dialog_title" id='score_title'></strong>
				</div>
				<div class="weui_dialog_bd" id="score_content"></div>
				<div class="weui_dialog_ft">
					<a onclick="scoreAlertYes()" href="#" class="weui_btn_dialog primary">确定</a>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script src="../../script/common.js"></script>
	<script src="../../script/swiper-3.4.2.jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/certificationExam.js"></script>
	<script type="text/javascript" src="../../script/attachmentManager.js"></script>
	<script type="text/javascript">
		var daan = new Object();
		//题目名称数组
		var itemNameArr = new Array();
		//题目id数组
		var itemIdArr = new Array();
		var qidArr = new Array();
		var clickNum = "";
		var pid = "";
		// 计划id
		var cid = "";
		//课程id
		var chapterid = "";
		var pscore = "60";
		//章节id
		var tid = "";
		var stime = "";
		var signature = "";
		var check_id = "";
		var timeNum = "";
		var enumber = "";
		var questionLen = "";
		//		var sid = "";
		var message;
		var message1;
		apiready = function() {
			preData();
			scrollUI();
			//开启加载框
			showProgress();
			// 滚动监听
			listenScroll();
			//获取数据
			//			loadData();
			//按钮返回提示
			kebackListen();
			// 当前试题数
		}
		//预加载数据
		function preData() {
			var h = api.winHeight * 0.3;
			$('#popover-card').css('height', h);
			if (api.pageParam.type == 3) {
				$('#title').text('理论模拟');
				message = '开始理论模拟考试' + '<br/>' + api.pageParam.quarter_name + '认证';
				message1 = '完成理论模拟考试' + '<br/>' + api.pageParam.quarter_name + '认证';
			} else if (api.pageParam.type == 4) {
				$('#title').text('技能模拟');
				message = '开始技能模拟考试' + '<br/>' + api.pageParam.quarter_name + '认证';
				message1 = '完成技能模拟考试' + '<br/>' + api.pageParam.quarter_name + '认证';
			}
			if (api.pageParam.isAgaintest && api.pageParam.hasOwnProperty("isAgaintest")) {//考试结果
				$('#score_div').show();
				$('#submit_div').hide();
				loadTestScoreData();
			} else {
				SendBehaviorTrajectoriesNotifi_Authentication('0', '模拟考试页', '126', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title, message);
				$('#submit_div').show();
				$('#score_div').hide();
				loadTestData();
			}
		}

		//倒计时
		function daojishi() {
			var t = setInterval(function() {
				if (timeNum != null && timeNum != '') {
					if (timeNum > 0) {
						timeNum--;
						var currentTime = sZhuanHms(timeNum);
						x = document.getElementById("kaoShiTime");
						//查找元素
						x.innerHTML = currentTime;
					} else {
						clearTimeout(t);
						api.toast({
							msg : '答题时间已到正在为您交卷'
						});
						DeleteAnswerNullData();
						SubmitData();
					}
				}
			}, 1000);
		}

		//加载题目数据
		function loadTestData() {
			var param = {
				uid : $api.getStorage('cfnetppuid'),
				exam : api.pageParam.exam,
				cid : api.pageParam.cid,
				quarter_id : api.pageParam.id,
				type : api.pageParam.type,
			};
			cfnetppPOST(url_startexam, param, false, function(data, status) {
				api.refreshHeaderLoadDone();
				hideProgress();
				if (status == 'success') {
					if (data.code == 200) {
						var list = data.data;
						if (list != null && list != "") {
							var kstime = parseInt(list.dtime) / 60;
							$('#summary').text(list.ksdata.ename);
							$('#score').text(list.zsorce);
							$('#passscore').text(list.ksdata.efen);
							$('#kstime').text(kstime);
							if (list.ksdata.efen != null && list.ksdata.efen != '') {
								pscore = list.ksdata.efen;
							}
							if (list.dtime != null && list.dtime != '' && list.dtime > 0) {
								timeNum = parseInt(list.dtime);
							}
							stime = list.stime;
							signature = list.signature;
							check_id = list.check_id;
							enumber = list.enumber;
							if (list.shitiarr != null && list.shitiarr != '') {
								var TestData = GetTestData(list.shitiarr);
								questionLen = TestData.length;
								setUpObject(TestData);
								$(".swiper-wrapper").append(SetTestExamUI(TestData));
								InitmySwiper();
								daojishi();
							} else {
								PopupHint2('题目为空');
							}
						} else {
							api.toast({
								msg : '获取测验题目数据失败',
								duration : 2000,
								location : 'bottom'
							});
						}
					} else if (data.code == 102) {
						back('您已经参加过考试，请等待下次考试机会');
					} else {
						api.toast({
							msg : '获取测验题目数据失败',
							duration : 2000,
							location : 'bottom'
						});
					}
				} else {
					api.toast({
						msg : '获取测验题目数据失败',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		//自由课程获取已提交测验信息
		function loadTestScoreData() {
			var params = {
				uid : $api.getStorage('cfnetppuid'),
				quarter_id : api.pageParam.id,
				exam_id : api.pageParam.exam,
				cjid : api.pageParam.cjid,
			};
			cfnetppPOST(url_getstore, params, false, function(data, status) {
				hideProgress();
				if (status == 'success') {
					if (data.status == true) {
						var list = data.data;
						if (list != null) {
							$('#summary').text(list.ename);
							$('#score').text(list.zsorce);
							$('#passscore').text(list.efen);
							$('#kstime').text(list.dtime);
							$('#Testscore').text(list.chengji);
							json_jieguo = data.data.json_jieguo;
							//考核完是否显示成绩
							e_display_cj = parseInt(list.e_display_cj);
							//是否显示答案
							e_display_da = parseInt(list.e_display_da);
							if (list.shitiarr != null && list.shitiarr != '') {
								var dataArr = GetTestData(list.shitiarr);
								SetExamScoreUI(dataArr);
							} else {
								PopupHint2('题目为空');
							}
						} else {
							api.toast({
								msg : '获取测验题目数据失败',
								duration : 2000,
								location : 'bottom'
							});
						}
					} else {
						api.toast({
							msg : '获取测验题目数据失败',
							duration : 2000,
							location : 'bottom'
						});
					}
				} else {
					api.toast({
						msg : '获取测验题目数据失败',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		function PopupHint2(str) {
			$("#checkNum2").text(str);
			$('#closeAlert').show();
		}

		function Cancel() {
			$('#closeAlert').hide();
			backClick();
		}

		// 滚动监听
		function listenScroll() {
			var winHeight = $(window).height();
			//获取当前页面高度
			$(window).resize(function() {
				var thisHeight = $(this).height();
				if (winHeight - thisHeight > 50) {
					//当软键盘弹出，在这里面操作
					$("#sub_div").css('display', 'none');
				} else {
					$("#sub_div").css('display', 'block');
					//当软键盘收起，在此处操作
				}
			});
		}

		//根据题目qid创建空数组对象
		function setUpObject(data) {
			var questions = data;
			for (var i = 0; i < questions.length; i++) {
				var question = questions[i];
				qidArr.push(question.qid);
				if (question.qtype == '1' || question.qtype == '3' || question.qtype == '8' || question.qtype == '5' || question.qtype == '11') {//单选题
					//取出子题目
					daan[question.qid] = new String();
				} else if (question.qtype == '2' || question.qtype == '7' || question.qtype == '9') {//多选题识图题
					//取出子题目
					daan[question.qid] = new Array();
				} else if (question.qtype == '4' || question.qtype == '10' || question.qtype == '12') {//论述题
					//取出子题目
					daan[question.qid] = new Array();
				}
			}
		}

		//检查题目是否提交
		function CheckSubmit() {
			DeleteAnswerNullData();
			var daanLen = ObjectCount(daan);
			var strLen = questionLen - daanLen;
			if (strLen == 0) {
				$("#checkNum").text("是否确定提交？");
			} else {
				$("#checkNum").text("您还有" + strLen + "道题未提交,是否确定提交?");
			}
			$('#offlineAlert').show();
			clickNum = 1;
		}

		function kebackListen() {
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				//coding...
				backKey();
			});
		}

		//退出考试提示
		function backKey() {
			if (api.pageParam.isAgaintest && api.pageParam.hasOwnProperty("isAgaintest")) {//考试结果
				api.closeWin({
				});
			} else {
				$("#checkNum").text("是否确定退出考试?");
				$('#offlineAlert').show();
				clickNum = 2;
			}
		}

		function cleanCancel() {
			$('#offlineAlert').hide();
		}

		//确定
		function cleanConfirm() {
			$('#offlineAlert').hide();
			if (clickNum == 1) {
				DeleteAnswerNullData();
				SubmitData();
			} else if (clickNum == 2) {
				backClick();
			}
		}

		function backClick() {
			SendBehaviorTrajectoriesNotifi_Authentication('1', '模拟考试页', '126', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title, message);
			api.closeWin({
			});
		}

		//提交答题数据
		function SubmitData() {
			var param = {
				enumber : enumber, //考试编号
				signature : signature, //秘钥
				check_id : check_id, //章节id
				uid : $api.getStorage('cfnetppuid'), //用户id
				jid : $api.getStorage('cfnetppjid'), //集团id
				stime : stime, //开始答测验时间（时间戳）
				quarter_id : api.pageParam.id,
				vid : api.pageParam.id,
				xuan : daan,
				message : message1
			};
			//						alert(JSON.stringify(param));
			cfnetppPOST(url_add_Test, param, false, function(data, status) {
				hideProgress();
				if (api.pageParam.type == 3) {
					SendBusinessOperationsLogNotifi('模拟考试页', '126', param, param, '', data, '认证理论模拟考试提交考试接口', '126-01')
				} else if (api.pageParam.type == 4) {
					SendBusinessOperationsLogNotifi('模拟考试页', '126', param, param, '', data, '认证技能模拟考试提交考试接口', '126-02')
				}
				if (status == 'success') {
					if (data.code == 200) {
						openMockExamScore(data.cjid)
						ShowToast('提交成功');
					} else if (data.code == 108) {
						ShowToast('请勿重复提交');
					} else {
						api.toast({
							msg : '提交失败',
							duration : 2000,
							location : 'bottom'
						});
					}
				} else {
					api.toast({
						msg : '提交失败',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		function openMockExamScore(cjid) {
			api.pageParam['cjid'] = cjid;
			api.pageParam['isAgaintest'] = true;
			api.openWin({useWKWebView:true,
				name : 'MockExamFrame',
				url : 'MockExamFrame.html',
				pageParam : api.pageParam,
				bounces : false,
				vScrollBarEnabled : true,
				hScrollBarEnabled : false,
				slidBackEnabled : false,
				softInputMode : 'pan',
				reload : true
			});
		}

		//删除数组中为空的数据
		function DeleteAnswerNullData() {
			for (var k = 0; k < questionLen; k++) {
				GetAnswerData(k);
			}
			for (var k = 0; k < qidArr.length; k++) {
				if ( typeof daan[qidArr[k]] == 'string') {
					if (isEmpty(daan[qidArr[k]])) {
						delete daan[qidArr[k]];
						k = k - 1;
					}
				} else if ( typeof daan[qidArr[k]] == 'object') {
					if (isObjectEmpty(daan[qidArr[k]])) {
						delete daan[qidArr[k]];
						k = k - 1;
					}
				}
			}
		}

		function SetExamScoreUI(list) {
			var qxuan = '';
			var data = list;
			questionLen = data.length;
			//	生成答题卡题号
			var OrderNumStr = ''
			TestScorePopoverCardNum(questionLen);
			/*题目字符串*/
			var questionStr = '';
			/*答题结果*/
			var AnswerResults = "";
			/*多选题答案*/
			var Multiple_Answer = ""
			/*选项字符串*/
			var optionStr = "";
			for (var i = 0; i < questionLen; i++) {
				qxuan = JSON.parse(data[i].qxuanxiang);
				OrderNumStr = (i + 1) + '/' + questionLen + "." + "(" + judgeQuestionScore(data[i]) + "分)";
				questionStr = data[i].qtype != 11 ? questionsItemIsNull(data[i].questions) : FillInBlankQuestionStr(data[i]);
				var userchoose = '';
				$(".swiper-wrapper").append('<div class="swiper-slide" id="item' + (i + 1) + '" itemtype="' + data[i].qtype + '"></div>')
				if (json_jieguo[data[i].qid] == "" || json_jieguo[data[i].qid] == null || json_jieguo.hasOwnProperty(data[i].qid) == false) {//提交结果为空
					data[i]["Cjjieguo"] = ''
				} else {
					data[i]["Cjjieguo"] = json_jieguo[data[i].qid];
				}
				if (data[i].qtype == 1 || data[i].qtype == 3 || data[i].qtype == 8) {
					AnswerResults = judgeAnswerType(fromCharCode(data[i].Cjjieguo), judgeQuestiondaan(data[i]), data[i].qtype, i);
					$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + CertificationQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + OrderNumStr + questionStr + '</p>' + AnswerResults + '<div class="test-answer-list left_10"  itemtype="' + data[i].qtype + '">' + '</div>' + '</div>')
					//	是单选或判断
					for (var k = 0; k < qxuan.length; k++) {
						var optionStr1 = data[i].qtype != 3 ? qxuan[k].xuanzhe : panxuanzeReturnStr(k);
						optionStr = xuanzheImgIsNull(optionStr1);
						if (data[i]["Cjjieguo"] != '') {//提交空题
							if ((k + 1 ) != json_jieguo[data[i].qid]) {
								$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-radio mui-left " >' + optionStr + '<input dataindex="' + (k + 1) + '"  onclick="return false;"   name="radio' + data[i].qid + '" type="radio"   itemid="' + data[i].qid + '">' + '</div> ')
							} else {
								$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-radio mui-left " >' + optionStr + '<input dataindex="' + (k + 1) + '"  checked="checked"  onclick="return false;"   name="radio' + data[i].qid + '" type="radio"   itemid="' + data[i].qid + '" >' + '</div> ')
							}
						} else {
							$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-radio mui-left Empty_title" >' + optionStr + '<input dataindex="' + (k + 1) + '"    onclick="return false;"   name="radio' + data[i].qid + '" type="radio"   itemid="' + data[i].qid + '"   >' + '</div> ')
						}
					}
				} else if (data[i].qtype == 2 || data[i].qtype == 9) {
					if (!isEmpty(data[i].qdaan)) {
						Multiple_Answer = strIsNullSpite(data[i].qdaan);
					} else if (!isEmpty(data[i].qjiexi)) {
						Multiple_Answer = strIsNullSpite(data[i].qjiexi);
					} else {
						Multiple_Answer = "暂无"
					}
					var keys1 = [];
					var userchooseLetter = [];
					if (data[i].Cjjieguo == '') {
						keys1 = [];
						userchooseLetter = []
					} else {
						var jsonObject1 = json_jieguo[data[i].qid];
						for (var p1 in jsonObject1) {
							if (jsonObject1.hasOwnProperty(p1)) {
								keys1.push(p1);
							}
						}
						for (var j = 0; j < keys1.length; j++) {
							userchooseLetter.push(fromCharCode(keys1[j]))
						}
					}
					AnswerResults = judgeAnswerType(userchooseLetter.toString(), Multiple_Answer, data[i].qtype, i);
					$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + CertificationQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + OrderNumStr + questionStr + '</p>' + AnswerResults + '<div class="test-answer-list left_10" >' + '</div>' + '</div>')
					for (var k = 0; k < qxuan.length; k++) {
						optionStr = xuanzheImgIsNull(qxuan[k].xuanzhe);
						if (keys1.toString().indexOf(k + 1) == -1) {
							$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-checkbox mui-left" >' + optionStr + '<input dataindex="' + (k + 1) + '" name="checkbox1"  onclick="return false;"    value="Item 1" type="checkbox"  itemid="' + data[i].qid + '">' + '</div>')
						} else {
							$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-checkbox mui-left" >' + optionStr + '<input dataindex="' + (k + 1) + '"  checked="checked"   onclick="return false;"  name="checkbox1" value="Item 1" type="checkbox"  itemid="' + data[i].qid + '">' + '</div>')
						}
					}
				} else if (data[i].qtype == 4 || data[i].qtype == 10 || data[i].qtype == 12) {
					AnswerResults = judgeAnswerType(data[i].Cjjieguo, judgeQuestiondaan(data[i]), data[i].qtype, i);
					$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + CertificationQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + OrderNumStr + questionStr + '</p>' + AnswerResults + '<div class="test-answer-list left_10"   >' + '</div>' + '</div>')
					// 论述
					$("#item" + (i + 1) + " .test-answer-list").append('<div class="test-answer-list">' + '<textarea  class="k-texttarea k-f14" readonly="readonly"    id="content" itemid="' + data[i].qid + '">' + isStringNull(json_jieguo[data[i].qid]) + '</textarea>' + '</div>')
				} else if (data[i].qtype == 7) {//识图题
					Multiple_Answer = strIsNullSpite(judgeQuestiondaan(data[i]));
					var keys1 = [];
					var userchooseLetter = [];
					if (data[i].Cjjieguo == '') {
						keys1 = [];
						userchooseLetter = []
					} else {
						var jsonObject1 = (json_jieguo[data[i].qid]);
						for (var p1 in jsonObject1) {
							if (jsonObject1.hasOwnProperty(p1)) {
								keys1.push(p1);
							}
						}
						for (var j = 0; j < keys1.length; j++) {
							userchooseLetter.push(fromCharCode(keys1[j]))
						}
					}
					AnswerResults = judgeAnswerType(userchooseLetter.toString(), Multiple_Answer, data[i].qtype, i);
					$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + CertificationQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + OrderNumStr + questionStr + '</p>' + AnswerResults + '<div class="test-answer-list left_10"  itemtype="' + data[i].qtype + '">' + '</div>' + '</div>')
					for (var k = 0; k < qxuan.length; k++) {
						optionStr = xuanzheImgIsNull(qxuan[k].xuanzhe);
						if (keys1.toString().indexOf(k + 1) == -1) {
							$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-checkbox mui-left" >' + optionStr + '<input dataindex="' + (k + 1) + '" name="checkbox1"  onclick="return false;"    value="Item 1" type="checkbox"  >' + '</div>')
						} else {
							$("#item" + (i + 1) + " .test-answer-list").append('<div class="mui-input-row mui-checkbox mui-left" >' + optionStr + '<input dataindex="' + (k + 1) + '"  checked="checked"   onclick="return false;"  name="checkbox1" value="Item 1" type="checkbox"  >' + '</div>')
						}
					}
				} else if (data[i].qtype == 5) {//上传题
					$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + CertificationQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + OrderNumStr + questionStr + '<p class="k-cred left_10">' + "移动端暂不支持上传题，请在PC端查看！" + '</p>' + '</p>' + '<div class="test-answer-list left_10"    onclick="return false;" itemtype="' + data[i].qtype + '">' + '</div>' + '</div>')
					//				} else if (data[i].qtype == 9) {//视频题
					//					$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + CertificationQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + OrderNumStr + questionStr + '<p class="k-cred left_10">' + "移动端暂不支持视频题，请在PC端查看！" + '</p>' + '</p>' + '<div class="test-answer-list left_10"    onclick="return false;" itemtype="' + data[i].qtype + '">' + '</div>' + '</div>')
				} else if (data[i].qtype == 11) {
					var user_answer = data[i].Cjjieguo.split('|');
					qdaanStr = judgeAnswerType(data[i].Cjjieguo, judgeQuestiondaan(data[i]), data[i].qtype, i);
					$("#item" + (i + 1)).append('<div class="k-con-part3 clearfix">' + '<span id="itemType" class="k-f18">' + CertificationQuestionTypeName(data[i].qtype) + '</span>' + '<p class="k-f16 k-c323 k-mt5 indent-5">' + OrderNumStr + questionStr + '</p>' + qdaanStr + '<div class="test-answer-list left_10" >' + '</div>' + '</div>');
					$.each(user_answer, function(k, e) {
						$("#item" + (i + 1)).find('.tiankong:eq(' + k + ')').attr("value", e)
						$("#item" + (i + 1)).find('.tiankong:eq(' + k + ')').attr("readonly", "readonly");
					});
				}
			}
			//  试题总数
			// 点击答题卡切换
			var mySwiper = new Swiper('.swiper-container', {
				autoHeight : true,
				autoplayDisableOnInteraction : false,
				direction : 'horizontal',
				loop : false,
			})
			// 点击答题卡切换
			$("#popover-card span").on("click", function() {
				var index = $(this).index();
				mySwiper.slideTo(index, 1000, false);
				mui('#popover-card').popover('hide');
			});
		}

		function judgeAnswerType(CjjieguoStr, qdaan, type, i) {
			var AnswerStr = "";
			var INFOStr = "";
			var jiexiStr = "";
			if (type == 4 || type == 10) {//论述题和案例分析题
				INFOStr = "解析是";
				jiexiStr = ", " + INFOStr + ":" + questionsItemIsNull(HTMLDecode(qdaan));
			} else {
				INFOStr = "正确答案是";
				jiexiStr = "";
			}
			/*是否显示正确答案*/
			if (!isEmpty(qdaan)) {
				AnswerStr = e_display_da == 2 ? ", " + INFOStr + ":" + questionsItemIsNull(HTMLDecode(qdaan)) : jiexiStr;
			} else {
				AnswerStr = "";
			}
			if (CjjieguoStr == '') {//提交结果为空
				$("#scroll-card").find("span").eq(i).removeClass('qusetion-num-selected').addClass('qusetion-num-normal');
				return '<p class="k-cred">' + "您未答题" + AnswerStr + '</p>'
			} else {
				if (CjjieguoStr == qdaan) {//答案正确
					$("#scroll-card").find("span").eq(i).removeClass('qusetion-num-selected').addClass('qusetion-num-true');
					return '<p class="k-cred">' + "恭喜您答对了" + AnswerStr + '</p>'
				} else {
					$("#scroll-card").find("span").eq(i).removeClass('qusetion-num-selected').addClass('qusetion-num-false');
					return '<p class="k-cred">' + "您答错了" + AnswerStr + '</p>'
				}
			}
		}

		function sendNotifi() {
			api.sendEvent({
				name : 'RreshMockExamListNotifi'
			});
		}
	</script>
</html>